<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/include/head.jsp"/>
</head>
<body>

<ol class="breadcrumb">
    <li><strong>当前位置： </strong>标准化管理</li>
    <li class="active">日程管理</li>
</ol>



<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title selectslid" style="display: inline-block">查询</h3>
        <a role="button" id="btn_add" style="float: right"
           class="btn btn-default btn-xs btn-info"
           href="javaScript:;"><span class="glyphicon glyphicon-plus-sign"></span> 添加</a>
    </div>
    <div class="panel-body">
        <form id="form_search" class="form-horizontal row">
            <div class="form-group col-sm-4 ">
                <label class="control-label col-sm-4 ">专家姓名：</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" name="expertName">
                </div>
            </div>

            <div class="form-group col-sm-4 ">
                <label class="col-sm-4 control-label">身份证号：</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" name="idCard">
                </div>
            </div>
            <div class="form-group col-sm-4">
                <div class="col-sm-6 col-sm-offset-2">
                    <button id="btn_search" type="button" class="btn btn-default "><span
                            class="glyphicon glyphicon-search"></span>&nbsp;查&nbsp;询&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
</div>


<table id="table_data"></table>

<div class="modal fade" id="modal_ajax">
    <div class="modal-dialog  modal-mid ">
        <div class="modal-content ">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>

<script>

    $("#btn_search").click(function(){
        $("#table_data").bootstrapTable('refresh');
    });

    $("#btn_add").click(function () {
        $('#modal_ajax').modal({
            backdrop: 'static',
            keyboard: false,
            show: true,
            remote: 'expertInfo/adminManagerSchedule/editDlg'
        });
    });

    $("#table_data").bootstrapTable({
        url: 'expertInfo/adminManagerSchedule/select',
        striped: true,
        cache: false,
        sidePagination: 'server',
        pageSize: 10,
        pageList: [10, 20, 50],
        pageNumber: 1,
        pagination: true,
        queryParams: function (params) {
            $.extend(params, $("#form_search").serializeObject());
            return params
        },
        columns: [
            {

                formatter: function (value, row, index) {
                    return [
                        index + 1
                    ].join('');
                }
            },
            {
                field: 'expertName',
                title: '姓名'
            }, {
                field: 'idCard',
                title: '身份证号'
            },

            {
                field: 'startTime',
                title: '开始时间',
                formatter: function (value, row, index) {
                    return $.Helper.dataTimeHelper.int2DateString(value);
                }
            },
            {
                field: 'endTime',
                title: '结束时间',
                formatter: function (value, row, index) {
                    return $.Helper.dataTimeHelper.int2DateString(value);
                }
            },
            {
                field: 'reason',
                width:250,
                title: '原因'
            }, {
                title: '操作',
                events: 'operateEvents',
                formatter: function (value, row, index) {
                    return [
                        '<button id="button" class="btn btn-default btn-xs   delete_data">',
                        '<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>',
                        ' 删 除',
                        '</button>'
                    ].join('');
                }
            }
        ]
    });

    window.operateEvents = {
        'click .delete_data': function (e, value, row, index) {
            $.sysPlugin.superAjax({
                data: {id: row.id},
                url: 'expertInfo/adminManagerSchedule/delete',
                operateType: 'delete',
                showSuccessAlert: true,
                showWarnAlert: true,
                successCall: function (data) {
                    $.sysPlugin.successCallBack(data, {
                        table: $("#table_data")
                    })
                }
            })
        }
    };
    $.sysPlugin.clearModalRemoveData("modal_ajax");
</script>


</body>
</html>
